import { ref } from 'vue'
import apiUserList from '@/api/modules/userList'
export const useHistoryStore = defineStore(
  // 唯一ID
  'user_list',
  () => {
    const total = ref(0)
    const list = ref([])
    async function getUserList(data: {
      page: number
      page_size: number
    }) {
      const res = await apiUserList.getUserList(data)
      total.value = res.data.Total
      list.value = res.data.Data
    }

    return {
      list,
      total,
      getUserList,
    }
  },
)

export default useHistoryStore
